//
//  JKStoreProductDetailVC.m
//  chequanbao_ios
//
//  Created by 朱凯 on 2018/1/29.
//  Copyright © 2018年 com.itboye. All rights reserved.
//

#import "JKStoreProductDetailVC.h"

// view
#import "JKViewProductDetailHeader.h"
#import "JKViewProductDetailStoreDetail.h"

@interface JKStoreProductDetailVC ()

@property (nonatomic, strong) UIScrollView *scroll;
@property (nonatomic, strong) JKViewProductDetailHeader *header;
@property (nonatomic, strong) JKViewProductDetailStoreDetail *storeView;

@end

@implementation JKStoreProductDetailVC

#pragma mark - 生命周期
- (void)viewDidLoad {
    [super viewDidLoad];

    self.title = @"和达城大酒店";
    
    [[self.view viewWithTag:888] removeFromSuperview];
    [self addColorLeftBackBarButtonItem];
    
    [self createViews];
}
- (void)viewWillAppear:(BOOL)animated {
    
    [super viewWillAppear:animated];
    
    [self setNaviAttributeWithTranslucent:false stateBarLightContent:false];
}

#pragma mark - 创建视图
- (void)createViews {
    
    _header = [JKViewProductDetailHeader new];
    [self.scroll addSubview:_header];
    [_header mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(@10);
        make.width.equalTo(@(SCREEN_WIDTH - 20));

    }];
    
    _storeView = [JKViewProductDetailStoreDetail new];
    [self.scroll addSubview:_storeView];
    [_storeView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.width.equalTo(_header);
        make.top.equalTo(_header.mas_bottom).offset(10);
        
        
        make.bottom.equalTo(@-10);
    }];
}

#pragma mark - 懒加载
- (UIScrollView *)scroll {
    
    if (!_scroll) {
        _scroll = [UIScrollView new];
        _scroll.backgroundColor = TABLE_COLOR;
        
        [self.view addSubview:_scroll];
        
        [_scroll mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.top.equalTo(@0);
            make.width.equalTo(@(SCREEN_WIDTH));
            if (@available(ios 11.0,*)) {
                make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
            } else {
                make.bottom.equalTo(@0);
            }
        }];
    }
    return _scroll;
}

@end
